    <div class="container">

      <div class="bg-putih">
        <div class="jdl-page">
          <?php echo isset($judul)?$judul:'<font color="#ccc">Judul Belum Diberikan</font>'; ?>
          <div class="clearfix"></div>
        </div>
        
        <?php echo display_flash(); ?>                
        <div class="row">
          <div class="col-xs-8">
            <div class="btn-group btn-group-sm" role="group">
              <a href="<?php echo site_url('obat_interaksi/add'); ?>" class="btn btn-primary"><i class="fa fa-plus"></i>&nbsp;Tambah</a>
              <?php if($this->uri->segment(2) == "search"): ?>
                <?php $keyword = $this->session->userdata('nama'); ?>
                <?php 
                $filter = $this->session->userdata('kelompok'); 
                if($filter == "" && $keyword == ""){
                  $filter = "";
                }elseif($filter == ""){
                  $filter = "null";
                }
                ?>                
                <a href="<?php echo site_url("obat_interaksi/excel/$filter/$keyword"); ?>" class="btn btn-warning"><i class="fa fa-file-excel-o"></i>&nbsp;Unduh Excel</a>
              <?php elseif($this->uri->segment(2) == ""): ?>
                <a href="<?php echo site_url('obat_interaksi/excel'); ?>" class="btn btn-warning"><i class="fa fa-file-excel-o"></i>&nbsp;Unduh Excel</a>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-xs-4">
            <?php echo form_open('obat_interaksi/search'); ?>
            <div id="txt-dropdown-search" class="input-group-3">                                        
              <button type="submit" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-search"></span></button>
              <script type="text/javascript">
                $(document).ready(function() {
                  $(".obat").select2();
                });
              </script>
              <input id="txt_search" type="text" class="form-control input-sm" name="nama" value="<?=$this->session->userdata('nama');?>" placeholder="Nama obat"/>              
              <select class="obat js-example-basic-single js-states form-control" name="kelompok">
                <?php  
                $klpk_getter = $this->db->get('kelompok');
                $res_klpk_getter = $klpk_getter->result_array();
                ?>
                <option value="" selected="selected">Kelompok</option>
                <?php foreach($res_klpk_getter as $kelompok):?>
                <option value="<?php echo $kelompok['KdKelompok'] ?>"><?php echo $kelompok['NmKelompok'] ?></option>
                <?php endforeach; ?>
              </select>
            </div>
            <?php echo form_close(); ?>
          </div>
        </div>

        <table class="table table-striped table-hover margintop20">
          <thead>
            <tr>
              <th width="3%" style="text-align:left;">No</th>
              <th width="14%" style="text-align:left;">Kode Interaksi</th>
              <th width="15%" style="text-align:left;">Obat 1</th>
              <th width="18%" style="text-align:left;">Obat 2</th>
              <th width="40%" style="text-align:left;">Interaksi</th>
            </tr>
          </thead>
          <tbody>
            <?php 
            if(!empty($results)){
              foreach ($results as $row) {
                ?>
                <tr>
                  <td align="center"><?php echo $ordinal_num++ ?></td>
                  <td><?php echo $row['KdInteraksi']?></td>
                  <td><?php echo $row['NmObat']?></td>
                  <?php  
                  $this->db->join('obat', 'obat.KdObat = interaksi.KdObat2');
                  $this->db->where('obat.KdObat', $row['KdObat2']);
                  $q_obat2 = $this->db->get('interaksi');
                  $obat2 = $q_obat2->result_array();
                  ?>
                  <td><?php echo $obat2[0]['NmObat'] ?></td>
                  <td>
                    <?php echo trim_text($row['Interaksi'], 40)?>
                    <span class="pull-right">
                      <a href="<?php echo site_url('obat_interaksi/edit/' . $row['KdInteraksi']) ?>" class="label label-success" title="Edit">Edit</a>
                      <a href="<?php echo site_url('obat_interaksi/delete/' . $row['KdInteraksi']) ?>" class="label label-default" title="Hapus" onClick="return confirm('Yakin ingin menghapus kode interaksi <?php echo $row['KdInteraksi']?> ?')">Hapus</a>
                    </span>
                  </td>
                </tr>
                <?php 
              }
            }else{
              ?>
              <tr>
                <td colspan="5" align="center">Tida ada data</td>
              </tr>
              <?php
            }
            ?>
          </tbody>
        </table>

        <center style="margin-top:-30px;">
          <ul class="pagination">
            <?php echo $pagination; ?>
          </ul>
        </center>

        <div class="clearfix"></div>
      </div>
    </div> <!-- /container -->